package com.tedu.assess.controller;

import com.tedu.assess.pojo.dto.AssessmentParam;
import com.tedu.assess.pojo.vo.AssessVO;
import com.tedu.assess.service.AssessmentService;
import com.tedu.common.response.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@Slf4j
@RequestMapping("/v1/health/addAssessment")
public class AssessmentController {
    @Autowired
    AssessmentService assessmentService;

    @PostMapping("save")
    public JsonResult save(AssessmentParam assessmentParam) {
        log.debug("新增健康评估:参数{}", assessmentParam);
        assessmentService.insert(assessmentParam);
        return JsonResult.ok();
    }
    @GetMapping("selectDetail")
    public JsonResult selectDetail( Integer id) {
        log.debug("查询健康详情:参数{}", id);
        AssessVO assessVO = assessmentService.selectDetail(id);
         return JsonResult.ok(assessVO);
    }
}
